﻿using Abp.Domain.Entities;
using Hicap.QRCodeWarehouse.Core.Models.Other;
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace Hicap.QRCodeWarehouse.Core.Models.DbSet
{
    public class FileRepository : Entity, IEntity, ISoftDelete
    {
        public string FileName { get; set; }

        public string Path { get; set; }

        public int RecordsCount { get; set; } = 0;

        public long Size { get; set; }

        public DateTime CreationTime { get; set; }

        public DateTime? LastDownloadDateTime { get; set; }

        public int DownloadTimes { get; set; }

        public long? UserId { get; set; }

        public FileSourceTypeEnum FileSourceType { get; set; }
        public bool IsInnerTypeBePrimary { get; set; }
        public FileTypeEnum FileType { get; set; }

        public string AllowDownloadUsers { get; set; }

        [Required]
        [ForeignKey("Product")]
        public int ProductId { get; set; }

        public Product Product { get; set; }

        public int GenerationRuleType { get; set; }

        public bool IsDeleted { get; set; }
    }
}